Skip to content

Generated secrets instead of literals (dittofeed, cryptomator, langfuse), langfuse worker, pinned images, index drift (#138) - #139

Merged
DeanKamali merged 1 commit into
mainfrom
dean/issue-138
Oct 20, 2026
Merged

DeanKamali merged 1 commit into
mainfrom
dean/issue-138

Conversation

@DeanKamali

Copy link
Copy Markdown
Contributor

Refs #138. This covers the parts fixable in templates alone; the rest needs platform support (listed below).

Merging publishes live to prod and api-dev on the next catalog fetch. Only new installs are affected. Nothing here has been test-deployed; it was validated against the server's own template code (below).

How generated secrets work (checked in kubero-server dev)

  • {{KUBERO_GEN_*}} tokens are replaced anywhere inside an env value, with a fresh value per app.
  • They're shared across a template group by env var name, and only for ALNUM: the dashboard's materializeSharedGenSecrets and the server's branch path both do this. HEX is never shared.
  • $(NAME) references are ordered by orderEnvVarsByReference, then expanded by Kubernetes.

Changes

  • dittofeed:
    • SECRET_KEY is now {{KUBERO_GEN_ALNUM:43}}=. Dittofeed decodes it from base64 and needs exactly 32 bytes (AES-256-GCM); checked over 20k samples.
    • The dashboard login PASSWORD is generated (ALNUM:24).
  • cryptomator:
    • HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET is generated and set on both Hub and the Keycloak companion.
    • New CRYPTOMATOR_REALM_ADMIN_PASSWORD. The realm JSON reads both via $(...). The admin password stays temporary with UPDATE_PASSWORD, so it must be changed at first login.
  • langfuse:
    • New langfuse-worker companion (ghcr.io/langfuse/langfuse-worker:3.225.11, serviceType: worker, inheritEnvFrom: primary, the n8n-worker pattern). v3 needs it for ingestion.
    • Web pinned from 3 to 3.225.11 (the same digest today).
    • NEXTAUTH_SECRET and SALT are generated (ALNUM:32) and inherited by the worker.
    • The wait loop dials $PGPORT instead of a hard-coded 5432.
  • posthog: latest pinned to 48912b83f12851f5ca9188750b6ade3b97f93616, the same digest as latest today. PostHog publishes only per-commit tags.
  • index.json: the 8 drifts from sync-index-addons.py applied by hand in minimal hunks. Only wagtail is a real change ([] → ["Cluster"]); the other 7 just reorder add-ons. The script now reports 0 updates.

Validation

  • lint-template-addons.py: OK. migrate-to-communal-db-env.py --check: the same 6 known failures as before.
  • Server's addon/security rules (Python copy, plus kubero-server dev's real validateAddonResourceDefinitions / appSecurityContextViolations): 0 of 300 templates fail.
  • Simulation with the server's instantiateTemplateGroup, orderEnvVarsByReference and findEnvInterpolationProblems, plus Kubernetes $(...) expansion:
    • cryptomator's realm JSON parses, and its client secret matches Hub's;
    • dittofeed's key decodes to 32 bytes;
    • langfuse worker and web share SALT, NEXTAUTH_SECRET, ENCRYPTION_KEY, the database URL, the S3 secret and the MinIO password.

Not done (needs platform support, filed separately)

  • ClickHouse admin passwords (dittofeed, langfuse, posthog, plausible) stay literal. The add-on CR and the app env are expanded separately, so a generated token would give two different values.
  • langfuse ENCRYPTION_KEY stays literal: it must be 64 hex characters, and HEX tokens aren't shared across a group.
  • cryptomator's keycloak database and dittofeed's Temporal CREATEDB on shared zones.
  • cryptomator's HUB_KEYCLOAK_PUBLIC_URL must still be set by hand after deploy.
  • langfuse's MinIO (cgr.dev/chainguard/minio) stays on latest; no other tags exist.
  • posthog's worker, plugin-server and migrate apps aren't added.
  • Companion sizing and the exposeInternet semantics need dashboard/server changes.

Follow-ups from #136 that the templates can fix on their own.

- dittofeed: SECRET_KEY and the dashboard PASSWORD are generated at
  deploy. SECRET_KEY is 43 random base64 characters plus '=', which
  decodes to the 32 bytes Dittofeed's AES-256-GCM key needs.
- cryptomator: HUB_KEYCLOAK_SYSTEM_CLIENT_SECRET is generated and shared
  by name between Hub and the Keycloak companion; the seed realm reads
  it, and a generated CRYPTOMATOR_REALM_ADMIN_PASSWORD, through $(NAME)
  references that Kubernetes expands.
- langfuse: add the langfuse-worker companion (v3 ingestion; inherits the
  web app's env). Pin web and worker to 3.225.11, which is what `3`
  points at now. NEXTAUTH_SECRET and SALT are generated. The startup
  wait loop dials $PGPORT instead of a hard-coded 5432.
- posthog: pin the image to the master commit tag that `latest` points
  at now (PostHog publishes no release tags).
- index.json: apply the 8 add-on drifts sync-index-addons.py reports
  (wagtail gains Cluster; the rest are reorders) without reformatting
  the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants